
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE [dbo].[gspSiteContentType_SEARCH]
(
@siteContentTypeId int = null,
@code int = null,
@name nvarchar(100) = null,
@targetPage nvarchar(100) = null
)
AS

SELECT
  *
FROM
  [dbo].[SiteContentType]
WHERE
  (@siteContentTypeId IS NULL OR [SiteContentTypeId] = @siteContentTypeId)
AND
  (@code IS NULL OR [Code] = @code)
AND
  (@name IS NULL OR @name = '' OR [Name] = @name)
AND
  (@targetPage IS NULL OR @targetPage = '' OR [TargetPage] = @targetPage)
  

GO
